package core.september.cloudbadge.vcard.badgemodel.fields;

import javax.persistence.Embeddable;

import ezvcard.parameters.ImageTypeParameter;
import ezvcard.types.PhotoType;


public class PhotoField extends AbsField{

	
	public PhotoType getPhotoType() {
		if(getVcard().getPhotos() == null || getVcard().getPhotos().size() == 0 ){
			return getVcard().getPhotos().get(0);
		}
		
		return null;
	}
	
	public void setPhoto(byte[] data, ImageTypeParameter itp) {
		getVcard().addPhoto(new PhotoType(data, itp));
	}
	
	@Override
	public void commit() {
		// TODO Auto-generated method stub
		
	}

}
